# -*- coding: UTF-8 -*-
import pytest
import sqlite3

@pytest.fixture(scope='module')
def connects():
    conn = sqlite3.connect('funds.db')
    print('连接成功')
    yield conn
    conn.close()
    print('连接关闭')

def test1_conn(connects):
    cur = connects.cursor()
    data = cur.execute('select count(*) from fund')
    value = data.fetchone()
    result = value[0]
    assert result == 11201

if __name__ == '__main__':
    pytest.main(['-s','yangsy.py'])


